package com.itheima.reggie.common;
/*
    给予ThreadLocal封装工具类
 */
public class BaseContext {
    /*
        获取当前线程的独立副本
     */
    private static ThreadLocal<Long> threadLocal = new ThreadLocal<>();
    /*
        设置一个当前id，该id在LoginCheckFilter中获取
     */
    public static void setCurrentId(Long id){
        threadLocal.set(id);
    }
    /*
        获取id
     */
    public static Long getCurrentId(){
        return threadLocal.get();
    }
}
